package top.huhuiyu.spirngboot2.total.dp;

public class Factory {

    public static Company createCompany(String name) {
        if ("ms".equals(name)) {
            return new Microsoft();
        } else if ("sony".equals(name)) {
            return new Sony();
        } else {
            throw new RuntimeException("暂不支持该厂商");
        }
    }


}
